package com.back.array;

/**
 * 复习数组
 *
 * @author kangjx
 * @version 1.0
 * @date 2023/7/15 下午12:40
 */
public class Array01 {

    public static void test01() {
        int a = 9;
//        System.out.println(a);

        //new 引用
//        int[] as = new int[2];
//        as[0] = 3;
//        as[1] = 31;
//        System.out.println(as[0]);

        int[] arr = {1, 2, 3, 4};

        //有一个数组长度10 存储10个整数11
        for (int i = 0; i < arr.length; i++) {
            arr[i] = 11 + i;
        }

        int[] as = new int[20];
        //1定义数组
        //2 赋値 循环 20 1
        int x = 0;
        while (x < as.length) {
            as[x] = x + 1;
            x++;
        }

        int y = 0;
        do {
            System.out.println(as[y++]);
        } while (y < as.length);
        //分析 : while(){}

        //1 : 2 4 6 8 10

    }

    public static void main(String[] args) {
        test01();
    }


}
